import { dataQueryAxios } from '@/utils/request.ts'

export const exportList = (params: {
  keywords?: string
  type?: string
  status?: string
  view_all?: string
  release_item_id?: string
  page: number
  page_size: number
}): Promise<any> => {
  return dataQueryAxios({
    url: `/api/data-query/v1/exports`,
    method: 'get',
    params
  })
}

export const exportToEmail = (id: string) => {
  return dataQueryAxios({
    url: `/api/data-query/v1/exports/${id}:send-email`,
    method: 'post'
  })
}

export const deleteExport = (id: string) => {
  return dataQueryAxios({
    url: `/api/data-query/v1/exports/${id}`,
    method: 'delete'
  })
}

export const editExportName = (
  id: string,
  data: {
    name: string
  }
) => {
  return dataQueryAxios({
    url: `/api/data-query/v1/exports/${id}`,
    method: 'put',
    data
  })
}
